home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / grafica / amhelios / surface3.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  2KB  |  84 lines

  1. ////////////////////////////////////////////////////////////
  2. //
  3. //  SURFACE3.H - 3-D Surface Class
  4. //
  5. //  Version:    1.03A
  6. //
  7. //  History:    94/08/23 - Version 1.00A release.
  8. //              94/12/16 - Version 1.01A release.
  9. //              95/02/05 - Version 1.02A release.
  10. //              95/07/21 - Version 1.02B release.
  11. //              96/02/14 - Version 1.02C release.
  12. //              96/04/01 - Version 1.03A release.
  13. //
  14. //  Compilers:  Microsoft Visual C/C++ Professional V1.5
  15. //              Borland C++ Version 4.5
  16. //
  17. //  Author:     Ian Ashdown, P.Eng.
  18. //              byHeart Software Limited
  19. //              620 Ballantree Road
  20. //              West Vancouver, B.C.
  21. //              Canada V7S 1W3
  22. //              Tel. (604) 922-6148
  23. //              Fax. (604) 987-7621
  24. //
  25. //  Copyright 1994-1996 byHeart Software Limited
  26. //
  27. //  The following source code has been derived from:
  28. //
  29. //    Ashdown, I. 1994. Radiosity: A Programmer's
  30. //    Perspective. New York, NY: John Wiley & Sons.
  31. //
  32. //  It may be freely copied, redistributed, and/or modified
  33. //  for personal use ONLY, as long as the copyright notice
  34. //  is included with all source code files.
  35. //
  36. ////////////////////////////////////////////////////////////
  37.  
  38. #ifndef _SURFACE3_H
  39. #define _SURFACE3_H
  40.  
  41. #include "patch3.h"
  42.  
  43. class Surface3  // 3-D surface
  44. {
  45.   private:
  46.     Spectra reflectance;    // Spectral reflectance
  47.     Spectra emittance;      // Initial radiant exitance
  48.     Patch3 *pplhd;          // Patch list head pointer
  49.     Surface3 *pnext;        // Next surface pointer
  50.  
  51.   public:
  52.     Surface3( Spectra reflect, Spectra emit )
  53.     {
  54.       reflectance = reflect;
  55.       emittance = emit;
  56.  
  57.       pplhd = NULL;
  58.       pnext = NULL;
  59.     }
  60.  
  61.     ~Surface3()
  62.     {
  63.       Patch3 *pp = pplhd;
  64.       Patch3 *ppnext;
  65.  
  66.       while (pp != NULL)        // Delete patches
  67.       {
  68.         ppnext = pp->GetNext();
  69.         delete pp;
  70.         pp = ppnext;
  71.       }
  72.     }
  73.  
  74.     Spectra &GetReflectance() { return reflectance; }
  75.     Spectra &GetEmittance() { return emittance; }
  76.     Patch3 *GetPatchPtr() { return pplhd; }
  77.     Surface3 *GetNext() { return pnext; }
  78.     void SetNext( Surface3 *pn ) { pnext = pn; }
  79.     void SetPatchPtr( Patch3 *pp ) { pplhd = pp; }
  80. };
  81.  
  82. #endif
  83.  
  84.